import java.util.Scanner;

public class java20231108 {

    public static int fact(int n){
        if(n==1){
            return 1;
        }
        return n*fact(n-1);
    }

    public static void main1(String[] args) {
        Scanner sc=new Scanner(System.in);
        int a= sc.nextInt();
        System.out.println(fact(a));
    }


    public static int sum(int n){
        if(n==1){
            return 1;
        }
        return n+sum(n-1);
    }
    public static void main2(String[] args) {
        Scanner sc=new Scanner(System.in);
        int b=sc.nextInt();
        System.out.println(sum(b));
    }

    public static void print(int n){
        if(n<10){
            System.out.println(n%10);
            return;
        }
        print(n/10);
        System.out.println(n%10);
    }
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int c=sc.nextInt();
        print(c);
    }
}
